package com.blackitheima2.LambdaDemo.test5;
//Lambda 表达式,带参带返回值
public class TestSum {
    public static void main(String[] args) {
        //匿名内部类
        getSum(new AddInt() {
            @Override
            public int getNumber(int x, int y) {
                return x+y;
            }
        });
        //Lambda 表达式
        getSum((x,y)->x+y);

    }
    public static void getSum(AddInt addInt){
        int sum=addInt.getNumber(2,3);
        System.out.println(sum);
    }
}
//接口
interface AddInt{
    public abstract int getNumber(int x,int y);
}
